<template>
  <el-card class="app-container">
    <c-u-r-d-table :option="option"/>
  </el-card>
</template>

<script>

import ColumnType from '@/framework/constant/ColumnType'
import OnlineStatusEnum from '@/framework/constant/OnlineStatusEnum'
import {shortcutApi} from '@/feature/page/infra/api/icon'
import CURDTable from '@/framework/components/table/CURDTable'

export default {
  components: {CURDTable},
  data() {
    return {
      option: {
        requestApi: shortcutApi,
        showSelection: true,
        columns: [
          // {
          //   label: '类型',
          //   prop: 'shortcutType',
          //   type: ColumnType.NUMBER
          // },
          {
            label: '名称',
            prop: 'shortcutName',
            required: true,
            width: 'auto',
            searchable: true,
            span: 24
          },
          {
            label: '链接',
            prop: 'shortcutUrl',
            span: 24,
            required: true,
            type: ColumnType.TEXTAREA
          },
          {
            label: '状态',
            searchable: true,
            required: true,
            type: ColumnType.RADIO,
            hiddenInForm: true,
            options: OnlineStatusEnum,
            prop: 'status'
          },
          {
            label: '图标',
            required: true,
            prop: 'shortcutIcon',
            width: 80,
            type: ColumnType.IMAGE
          },
          {
            label: '排序',
            required: true,
            prop: 'sortNum',
            type: ColumnType.NUMBER,
            defaultValue: 0
          },
          {
            label: '创建时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtCreate'
          },
          {
            label: '修改时间',
            type: ColumnType.DATETIME,
            hiddenInForm: true,
            prop: 'gmtModified'
          }
        ]
      }
    }
  },
  methods: {}
}
</script>

